﻿using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;

namespace VendorExpenses.Model
{
    public class Vendor
    {
        private ICollection<Expense> expenses;

        [BsonId]
        public ObjectId _VendorId { get; set; }
        public int VendorId { get; set; }
        public string VendorName { get; set; }

        [BsonConstructor]
        public Vendor()
        {
            this.expenses = new HashSet<Expense>();
        }

        public virtual ICollection<Expense> Expenses
        {
            get { return this.expenses; }
            set { this.expenses = value; }
        }
    }
}
